<?php

abstract class POJO extends stdClass
{
    /**
     * @param array $data
     * @return POJO
     */
    public function __construct($data)
    {
        foreach ($data as $key => $value) {
            $this->$key = $value;
        }

        $this->convert();
    }

    /**
     * @return void
     */
    protected abstract function convert();
}
